package com.zcc.makingfriend.mapper;

import com.zcc.makingfriend.dao.Article;
import com.zcc.makingfriend.dto.PageDto;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author zcc
 */
@Mapper
public interface ArticleMapper {
    List<Article> getAllArticles(int page, int size);

    List<Article> getLikeArticles(int page, int size);

    List<Article> getArticlesByCondition(PageDto pageDto);

    List<Article> searchArticle(String content, int page, int size);

    List<Article> getArticleByAuthor(Long authorId, int page, int size);

    List<Article> getAllArticleById(Long id);

    Article getArticleById(Long id);

    Article getArticleByUuid(String uuid);

    int addArticle(Article article);

    int deleteArticle(String uuid);

    int deleteArticleById(Long id);

    int updateArticle(Article article);

    int isLikeArticle(int likes, String uuid);

    Long countArticles();

    Long countConditionArticles(PageDto pageDto);

    int reportArticle(Long articleId);

    int recoverReportArticle(Long articleId);

    Long countReportArticle();

    List<Article> findReportArticleByCondition(PageDto pageDto);

    Long countConditionReportArticles(PageDto pageDto);
}
